home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-25 | 9.1 KB | 333 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWIters.h
- // Release Version: $ ODF 1 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
- //
- // This file contains the following iterators
- //
- // - FW_CODFrameFacetIterator
- //
- // - FW_CEmbeddedODFacetsIterator
- // Iterates trought all the facets embedded in one of your display facet for a specific proxy.
- // If the embedding facet is NULL, returns all the embedded facets for a proxy.
- //
- // - FW_CFacetIterator
- // Wrapper for ODFacetIterator, safe for exception.
- //
- // - FW_CFrameFacetIterator
- // Allows you to iterator through all the facets of a display frame.
- //
- // - FW_CPresentationFrameIterator
- //
- // - FW_CPresentationFacetIterator
- //
- // - FW_CFrameProxyFrameIterator
- //
- // - FW_CFrameEmbeddedFrameIterator
- //
-
- #ifndef FWITERS_H
- #define FWITERS_H
-
- #ifndef FWSTDDEF_H
- #include "FWStdDef.h"
- #endif
-
- #ifndef FWEXCLIB_H
- #include "FWExcLib.h"
- #endif
-
- #ifndef FWPART_H
- #include "FWPart.h"
- #endif
-
- #ifndef FWPROXY_H
- #include "FWProxy.h"
- #endif
-
- #ifndef FWFRMING_H
- #include "FWFrming.h"
- #endif
-
- #ifndef FWPRESEN_H
- #include "FWPresen.h"
- #endif
-
- #ifndef FWPXYFRM_H
- #include "FWPxyFrm.h"
- #endif
-
- #ifndef FWPRTITE_H
- #include "FWPrtIte.h"
- #endif
-
- #ifndef FWORDCOL_H
- #include "FWOrdCol.h"
- #endif
-
- // ----- OpenDoc Includes -----
-
- #ifndef SOM_ODFacetIterator_xh
- #include <FacetItr.xh>
- #endif
-
- #ifndef SOM_ODFocusSetIterator_xh
- #include "FocusItr.xh"
- #endif
-
- #ifndef SOM_ODFrameFacetIterator_xh
- #include <FrFaItr.xh>
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class FW_CPart;
- class FW_CFrame;
- class FW_CEmbeddingFrame;
- class FW_CFrameFacetIterator;
- class ODFacet;
- class ODFrame;
-
- //========================================================================================
- // class FW_CODFrameFacetIterator
- //========================================================================================
-
- class FW_CODFrameFacetIterator
- {
- public:
- FW_DECLARE_AUTO(FW_CODFrameFacetIterator)
-
- FW_CODFrameFacetIterator(Environment* ev, ODFrame* odFrame);
- virtual ~FW_CODFrameFacetIterator();
-
- ODFacet* First(Environment* ev)
- {return fODFrameFacetIte->First(ev);}
- ODFacet* Next(Environment* ev)
- {return fODFrameFacetIte->Next(ev);}
-
- FW_Boolean IsNotComplete(Environment* ev)
- {return fODFrameFacetIte->IsNotComplete(ev);}
-
- private:
- ODFrameFacetIterator *fODFrameFacetIte;
- };
-
- //========================================================================================
- // class FW_CFrameFacetIterator
- //========================================================================================
-
- class FW_CFrameFacetIterator : public FW_CODFrameFacetIterator
- {
- public:
- FW_DECLARE_AUTO(FW_CFrameFacetIterator)
-
- FW_CFrameFacetIterator(Environment* ev, const FW_CFrame* frame);
- virtual ~FW_CFrameFacetIterator();
- };
-
- //========================================================================================
- // class FW_CFacetIterator
- //========================================================================================
-
- class FW_CFacetIterator
- {
-
- public:
- FW_DECLARE_AUTO(FW_CFacetIterator)
-
- FW_CFacetIterator(Environment* ev,
- ODFacet* facet,
- ODTraversalType traversalType = kODChildrenOnly,
- ODSiblingOrder siblingOrder = kODFrontToBack);
- ~FW_CFacetIterator();
-
- ODFacet* First(Environment* ev)
- {return fODFacetIterator->First(ev);}
- ODFacet* Next(Environment* ev)
- {return fODFacetIterator->Next(ev);}
- FW_Boolean IsNotComplete(Environment* ev)
- {return fODFacetIterator->IsNotComplete(ev);}
- void SkipChildren(Environment* ev)
- {fODFacetIterator->SkipChildren(ev);}
-
- private:
- ODFacetIterator *fODFacetIterator;
- };
-
- //========================================================================================
- // class FW_CPresentationFrameIterator
- //========================================================================================
-
- class FW_CPresentationFrameIterator
- {
- public:
- FW_DECLARE_AUTO(FW_CPresentationFrameIterator)
-
- FW_CPresentationFrameIterator(Environment* ev,
- FW_CPresentation* presentation);
- FW_CPresentationFrameIterator(Environment* ev,
- FW_CPresentation* presentation,
- ODID frameGroup,
- ODID sequenceNumber);
- ~FW_CPresentationFrameIterator();
-
- FW_CFrame* First(Environment* ev);
- FW_CFrame* Next(Environment* ev);
- FW_CFrame* Last(Environment* ev);
- FW_CFrame* Previous(Environment* ev);
- FW_Boolean IsNotComplete(Environment*)
- {return fCurrentFrame != NULL;}
-
- protected:
- FW_CFrame* GetNext(Environment* ev, FW_CPrivDisplayFrame* displayFrame);
- FW_CFrame* GetPrevious(Environment* ev, FW_CPrivDisplayFrame* displayFrame);
-
- private:
- FW_CFrame* fCurrentFrame;
- FW_TOrderedCollectionIterator<FW_CPrivDisplayFrame> fIterator;
- ODID fFrameGroup;
- ODID fSequenceNumber;
- };
-
- //========================================================================================
- // class FW_CPresentationFacetIterator
- //========================================================================================
-
- class FW_CPresentationFacetIterator
- {
- public:
- FW_DECLARE_AUTO(FW_CPresentationFacetIterator)
-
- FW_CPresentationFacetIterator(Environment* ev, FW_CPresentation* presentation);
- ~FW_CPresentationFacetIterator();
-
- ODFacet* First(Environment* ev);
- ODFacet* Next(Environment* ev);
- FW_Boolean IsNotComplete(Environment*)
- {return fCurrentFacet != NULL;}
-
- private:
- ODFacet* ResetFacetIterator(Environment* ev, FW_CFrame* frame);
-
- private:
- FW_CPresentationFrameIterator fFrameIterator;
- FW_CFrameFacetIterator* fFacetIterator;
- ODFacet* fCurrentFacet;
- };
-
- //========================================================================================
- // FW_CEmbeddedODFacetsIterator
- //========================================================================================
-
- class FW_CEmbeddedODFacetsIterator
- {
- public:
- FW_DECLARE_AUTO(FW_CEmbeddedODFacetsIterator)
-
- FW_CEmbeddedODFacetsIterator(Environment* ev, const FW_MProxy* proxy, ODFacet* embeddingFacet, ODSiblingOrder siblingOrder);
- ~FW_CEmbeddedODFacetsIterator();
-
- ODFacet* First(Environment* ev);
- ODFacet* Next(Environment* ev);
- FW_Boolean IsNotComplete(Environment* ev);
-
- private:
- ODFacet* PrivFindNext(Environment* ev, ODFacet* facet);
-
- private:
- ODFacetIterator* fODFacetIterator;
- ODPart* fEmbeddedODPart;
- ODID fSequenceNumber;
- ODID fFrameGroup;
- ODFacet* fODFacet;
- };
-
- //========================================================================================
- // class FW_CFrameProxyFrameIterator
- //========================================================================================
-
- class FW_CFrameProxyFrameIterator
- {
- public:
- FW_DECLARE_AUTO(FW_CFrameProxyFrameIterator)
-
- FW_CFrameProxyFrameIterator(Environment* ev, const FW_CEmbeddingFrame* frame);
- ~FW_CFrameProxyFrameIterator();
-
- FW_CProxyFrame* First(Environment* ev);
- FW_CProxyFrame* Next(Environment* ev);
- FW_CProxyFrame* Last(Environment* ev);
- FW_CProxyFrame* Previous(Environment* ev);
- FW_Boolean IsNotComplete(Environment*)
- {return fCurrentFrame != NULL;}
-
- protected:
- FW_CProxyFrame* GetNext(Environment* ev, FW_MProxy* proxy);
- FW_CProxyFrame* GetPrevious(Environment* ev, FW_MProxy* proxy);
-
- private:
- ODID fContainerID;
- FW_CProxyFrame* fCurrentFrame;
- FW_CPartProxyIterator fProxyIterator;
- };
-
- //========================================================================================
- // class FW_CFrameEmbeddedFrameIterator
- //========================================================================================
-
- class FW_CFrameEmbeddedFrameIterator
- {
- public:
- FW_DECLARE_AUTO(FW_CFrameEmbeddedFrameIterator)
-
- FW_CFrameEmbeddedFrameIterator(Environment* ev, const FW_CEmbeddingFrame* frame);
- ~FW_CFrameEmbeddedFrameIterator();
-
- ODFrame* First(Environment* ev);
- ODFrame* Next(Environment* ev);
- ODFrame* Last(Environment* ev);
- ODFrame* Previous(Environment* ev);
- FW_Boolean IsNotComplete(Environment*)
- {return fCurrentFrame != NULL;}
-
- private:
- ODFrame* PrivNext(Environment* ev, FW_CProxyFrame* proxyFrame);
- ODFrame* PrivPrevious(Environment* ev, FW_CProxyFrame* proxyFrame);
-
- private:
- FW_CFrameProxyFrameIterator fIterator;
- ODFrame* fCurrentFrame;
- };
-
- //========================================================================================
- // class FW_CFocusSetIterator
- //========================================================================================
-
- class FW_CFocusSetIterator
- {
- public:
- FW_DECLARE_AUTO(FW_CFocusSetIterator)
-
- FW_CFocusSetIterator(Environment* ev, const FW_CFrame* frame);
- ~FW_CFocusSetIterator();
-
- public:
- ODTypeToken First(Environment* ev)
- {return fIterator->First(ev);}
- ODTypeToken Next(Environment* ev)
- {return fIterator->Next(ev);}
- FW_Boolean IsNotComplete(Environment* ev)
- {return fIterator->IsNotComplete(ev);}
-
- private:
- ODFocusSetIterator* fIterator;
- };
-
- #endif
-